1. Field of the Invention
The present invention relates to a system and method for synchronizing files, and especially to a system and method for synchronizing files in multiple nodes via a central node in a network.
2. Description of Related Art
A large enterprise that has branch offices distributed in different areas typically uses an intranet for communication among the branch offices. The intranet comprises a plurality of local area networks (LAN). Each LAN includes at least one server computer and a plurality of client computers, which together constitute a network computer system. A characteristic feature of the network computer system is that the server computers only store resources, and the client computers only run client side programs to communicate with the server computers.
The resources stored in server computers include server side programs, data for processing, and so on. In practice, a variety of server computers have different uses. For example, an application server is used for running server application programs, a file server is used for uploading and downloading files, and a database server is used for accessing a vast store of structured data.
Clients in the intranet may need to compile a file that is cooperatively shared among different LANs. The file server in each LAN stores one copy of the file. In these circumstances, file synchronization of the copies of the file in the different file servers should be performed. This is needed in order to maintain consistency between any updated copy in one file server and other copies in the other file servers.
P.R.China Patent No. CN1353836 discloses a system and method for managing files in a distributed environment. The invention includes a method for synchronizing files among different nodes in a network. According to the invention, a file controller is installed on the client side. The file controller is used for managing local files, exchanging data among nodes, and generating indexes for orientating files in a network. When a user in a node requires access to a file, the file controller obtains the storage location of the file according to the relevant indexes, copies the file to the node, and amends information in the relevant indexes. When the copy of the file is changed, the file controller performs file synchronization with all other nodes that have other copies of the file according to the indexes of the file.
However, the method disclosed in this invention is still relatively rudimentary. There are two important shortcomings, as described below.
First, unneeded file synchronization is performed. Suppose that there are 3 nodes in a network named nodes A, B, C; and each node has one copy of a same file. When node A updates its copy, the copy in node C is updated accordingly. When node B updates its copy, the copy in node C is updated accordingly, too. But node C accesses its own copy only after Node B updates its copy. That means the first file synchronization in node C is not needed.
Second, in some cases of file synchronization, excessively large network communication traffic is required. Suppose that a file is needed by every node in a network, and each node has one copy of the file. When a copy of the file in one of the nodes is changed, all the other nodes are required to perform file synchronization with said one of the nodes at the same time. In this case, relatively heavy network communication traffic is needed.